package demo1;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Controller;

@Aspect
@Controller
public class MyAspect {
    @Pointcut("execution(* demo1.Calculation.*(..))")
    public void pointcut(){}

    @Before("pointcut()")
    public void qianzhi(){
        System.out.println("方法开始执行");
    }

    @After("pointcut()")
    public void houzhi(){
        System.out.println("方法执行完毕");
    }
}
